package com.ll.homework;

/**
 * @author 刘龙
 * @version 1.0
 */
public class Homework04 {
    public static void main(String[] args) {
        Cellphone cellphone = new Cellphone();
        cellphone.test();
        cellphone.testWork(new Computer() {
            @Override
            public void work() {

            }

            @Override
            public double work(double n1, double n2) {
                return n1 + n2;
            }
        }, 1, 2);
    }
}

interface Computer {
    public abstract void work();
    public double work(double n1, double n2);
}

class Cellphone {

    public void testWork(Computer computer, double n1, double n2) {
        double work = computer.work(n1, n2);
        System.out.println("计算的结果: " + work);
    }

    public void test() {
        Computer computer = new Computer() {

            @Override
            public void work() {

            }

            @Override
            public double work(double n1, double n2) {
                return 0;
            }
        };
        System.out.println(computer.getClass());

    }

}


